﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace H2.NET.Web.API.Service
{
    public class Validationcs
    {
        public static bool SyncValidate(object syncData)
        {
            bool result = true;
            Type type = syncData.GetType();
            DateTime dateTime = new DateTime ();
            decimal dec = new decimal();
            if (type == typeof(string))
            {
                if ((string)syncData == string.Empty)
                {
                    result = false;
                }
            }
            else if (type == typeof(int))
            {
                if ((int)syncData == 0)
                {
                    result = false;
                }
            }
            else if (type == typeof(decimal))
            {
                if ((decimal)syncData == dec)
                {
                    result = false;
                }
            }
            else if (type == typeof(DateTime))
            {
                if ((DateTime)syncData == dateTime)
                {
                    result = false;
                }
            }
            
            return result;
        }
    }
}